#pragma once
#include <opencv2/opencv.hpp>

#define BOARD_WIDTH 900
#define BOARD_HEIGHT 550

#define WHITE Scalar(255, 255, 255) 
#define GREEN Scalar(20, 200, 80)

void calibrate(const char*);
void perspectiveTransform(cv::Mat&);
bool loadLabelMatrix(const char* path);
int getLabel(cv::Rect&);
int getLabel(uint x, uint y);

struct Droplet {
    int id;
    cv::Rect bbox;
    Droplet(int id, cv::Rect& bbox) {
        this->id = id;
        this->bbox = bbox;
    }
};

void label2coor(int label, int& x, int& y);
bool isWorkedEletroid(int x, int y);